from django.conf.urls.defaults import *
import settings

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

# Testing django databrowse
from django.contrib import databrowse
from django.contrib.admin.views.decorators import staff_member_required
from lab.models import Lab, Researcher
from protocol.models import Committee, Institution, Protocol, Revision, RevisionName, RevisionFile
from experiment.models import Experiment, Race, SubjectCode, Subject, Phone, Email, Contact, CompensationType, CompensationSource, Location, SubjectSession, SubjectSessionFile
databrowse.site.register(Lab)
databrowse.site.register(Researcher)
databrowse.site.register(Committee)
databrowse.site.register(Institution)
databrowse.site.register(Protocol)
databrowse.site.register(RevisionName)
databrowse.site.register(Revision)
databrowse.site.register(RevisionFile)
databrowse.site.register(Experiment)
databrowse.site.register(Race)
databrowse.site.register(SubjectCode)
databrowse.site.register(Subject)
databrowse.site.register(Phone)
databrowse.site.register(Email)
databrowse.site.register(Contact)
databrowse.site.register(CompensationType)
databrowse.site.register(CompensationSource)
databrowse.site.register(Location)
databrowse.site.register(SubjectSession)
databrowse.site.register(SubjectSessionFile)

urlpatterns = patterns('',
    # (r'^accession/', include('accession.urls')),
    
    # Uncomment the admin/doc line below to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
    
    (r'^admin_tools/', include('admin_tools.urls')),
    
    # only for development...would need to change for production
    (r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': settings.MEDIA_ROOT}),
    
    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
    
    # databrowse
    (r'^databrowse/(.*)', staff_member_required(databrowse.site.root)),
)
